package com.ff.xyh.service.userfront.service;

import com.ff.xyh.common.entity.result.ResultObject;
import com.ff.xyh.common.entity.userfront.FrontUser;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;

/**
 * <p>
 * 前端用户表 服务类
 * </p>
 *
 * @author ff
 * @since 2022-10-25
 */
@CacheConfig(cacheNames = {"FrontUserService"})
public interface FrontUserService extends IService<FrontUser> {

    FrontUser login(String userToken, String password);
    @Cacheable(unless = "#result == null", key = "#id")
    String createTokenWithUserId(String id);

    @CacheEvict(key = "#id")
    boolean updateUserPasswordWithUserId(String id, String password);

    FrontUser updateUserLastLog(String id);

    @CacheEvict(key = "#id")
    FrontUser deleteUserById(String id);

    ResultObject getUserByOpenid(String openid);

//    UserBaseInfo getUserBaseInfoByToken(String token);
}
